<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>zmall网上商城-商店系统</title>
<meta name="author" content="DeathGhost" />
<link rel="stylesheet" type="text/css" href="goodsmanage/css/style.css">
<link rel="stylesheet" href="goodsmanage//layui/css/layui.css">
<style>
.head {
	height: 70px;
}

.title {
	position: absolute;
	width: 200px;
	left: 15px;
	height: 75px;
	color: white;
	line-height: 75px;
	font-size: 30px;
}
.container{
	width: 800px;

}
</style>
<!--[if lt IE 9]>
<script src="js/html5.js"></script>
<![endif]-->
<script src="js/jquery.js"></script>
<script src="js/jquery.mCustomScrollbar.concat.min.js"></script>
<script>
	(function($) {
		$(window).load(
				function() {

					$("a[rel='load-content']").click(
							function(e) {
								e.preventDefault();
								var url = $(this).attr("href");
								$.get(url, function(data) {
									$(".content .mCSB_container").append(data); //load new content inside .mCSB_container
									//scroll-to appended content 
									$(".content").mCustomScrollbar("scrollTo","h2:last");
								});
							});

					$(".content").delegate(
							"a[href='top']",
							"click",
							function(e) {
								e.preventDefault();
								$(".content").mCustomScrollbar("scrollTo",
										$(this).attr("href"));
							});

				});
	})(jQuery);
	
	
/**
 * 
	$(function() {
	
		//得到一个对象，或者多个对象，将对象显示层中
		$.get("GoodsManageServlet?op=doType", function(data) {
			// console.log(data);
			$.each(data, function(index, nt) {
			 //console.log(index+","+nt.id+","+nt.newstype);
				$("#typeid").append(
				"<option value="+nt.typeid+">" + nt.typename + "</option>");
			});
		});
	});*/
</script>
</head>
<body>
	<!--header-->
	<header class="head">
		<div class="title">zmall网上商城</div>
		<ul class="rt_nav">
			<li><a href="UserIndex.jsp" class="quit_icon">退出</a></li>
		</ul>
	</header>
	<!--aside nav-->
	<!--aside nav-->
	<aside class="lt_aside_nav content mCustomScrollbar">
		<h2>
			<a href="#">首页</a>
		</h2>
		<ul>
			<li>
				<dl>
					<dt>商品管理</dt>
					<!--当前链接则添加class:active-->
					<dd>
						<a href="product_list.jsp" class="active">商品列表</a>
					</dd>
				</dl>
			</li>
			<li>
				<dl>
					<dt>订单管理</dt>
					<dd>
						<a href="order_list.jsp">订单列表</a>
					</dd>
				</dl>
			</li>
			<li>
				<dl>
					<dt>评论管理</dt>
					<dd>
						<a href="comment_list.jsp">查看评论</a>
					</dd>
				</dl>
			</li>
		</ul>
	</aside>
	<section class="rt_wrap content mCustomScrollbar">
		<div class="rt_content ">
			<div class="page_title">
				<h2 class="fl">添加商品</h2>
				<a class="fr top_rt_btn" href="product_list.jsp">返回商品列表</a>
			</div>
     
     
      <div class="container" >
      	${msg == null ? "" : msg }
			<form class="layui-form" action="GoodsManageServlet" method="post" enctype="multipart/form-data">
				<input type="hidden" id="op" name="op" value="addgoods">
				<input type="hidden" name="shopid" value="${sessionScope.shopid}">
				<div class="layui-form-item">
					<label class="layui-form-label">商品编号</label>
					<div class="layui-input-block">
						<input type="text" name="goodsid" id="goodsid"  readonly class="layui-input">
					</div>
					<!-- 获取上个页面传过来的值 -->
					
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">商品名称</label>
					<div class="layui-input-block">
						<input type="text" name="goodsname" id="goodsname" required
							lay-verify="required" class="layui-input">
					</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">商品类别</label>
					
					<div class="layui-input-block">
					<select name="typeid" lay-verify="required" id="typeid">
						<option value="">请选择</option>
						<option value="1">苹果系列</option>
						<option value="2">华为系列</option>
					</select>
				</div>
				</div>


				<div class="layui-form-item layui-form-text">
					<label class="layui-form-label">商品简介</label>
					<div class="layui-input-block">
						<textarea name="goodsinfo" id="goodsinfo" class="layui-textarea"></textarea>
					</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">商品价格</label>
					<div class="layui-input-block">
						<input type="text" name="goodsprice" id="goodsprice" required
							lay-verify="required" class="layui-input">
					</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">商品库存</label>
					<div class="layui-input-block">
						<input type="text" name="goodscount" id="goodscount" required
							lay-verify="required" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">图片</label>
					<div class="layui-input-block" >
					<label class="uploadImg">
         				<input type="file" name="cover-file" id="cover-file" />
         				<span>上传图片</span>
       				 </label>	
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">商品状态</label>
					<div class="layui-input-block">
					<select name="goodsstate" lay-verify="required" id="goodsstate">
						<option value="0">上架</option>
						<option value="1">下架</option>
					</select>
				</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-input-block">
						<input type="submit" class="layui-btn" id="tijiao" value="提交"/>
						<button type="reset" class="layui-btn layui-btn-primary">重置</button>
					</div>
				</div>


			</form>
			</div>
		</div>
	</section>


		<div class="rt_content">
			<!--开始：以下内容则可删除，仅为素材引用参考-->
			<h1
				style="color: red; font-size: 20px; font-weight: bold; text-align: center;">商店首页</h1>
		</div>
<script type="text/javascript" src="goodsmanage/javascript/jquery.min.js"></script>
<script type="text/javascript" src="goodsmanage/layui/layui.js"></script>
<script src="goodsmanage/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="goodsmanage/javascript/goods.js"></script>

</body>
</html>